package cn.edu.scau.cmi.zhangmingxing.adapter;

import java.util.ArrayList;

public class AdapterOfObject extends SortUtil implements Target{
	public void sortStudent(ArrayList<Student> students,ArrayList<Integer> studentNumbers,int studentNumber,String studentName) {
     	students.add(new Student(studentNumber,studentName));	
		studentNumbers.add(studentNumber);
		SortUtil sortUtil=new SortUtil();
		sortUtil.sortInteger(studentNumbers);
		for(int i=0;i<students.size();i++) {
			Student temp=null;
			for(int j=i;j<students.size();j++) {
				if(students.get(j).getNumber()==studentNumbers.get(i)) {
					temp=students.get(i);
					students.set(i,students.get(j));
					students.set(j,temp);
					break;
				}
			}
		}
		
	}
}
